<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="crm.util.ParamUtil"%>
<%@page import="crm.model.Product_model"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Calendar" %>
<%@page import="crm.control.ProductControl"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>product_model_update_do</title>
    

  </head>
  
  <body>
       <%request.setCharacterEncoding("UTF-8");
         int id=Integer.parseInt(request.getParameter("id"));
         
         Product_model productModel=new Product_model();
         String model_number=ParamUtil.getString(request,"model_number");
         productModel.setModel_number(model_number);
         
         String model_name=ParamUtil.getString(request,"model_name");
         productModel.setModel_name(model_name);
         
         int system_product_id=ParamUtil.getInt(request,"product_model_system_product_id");
         productModel.setSystem_product_id(system_product_id);
         
         String develope_depart=ParamUtil.getString(request,"product_model_develope_department");
         productModel.setDevelope_depart(develope_depart);
         
         String developer=ParamUtil.getString(request,"product_model_developer");
         productModel.setDeveloper(developer);
         
         String price=ParamUtil.getString(request,"product_model_price");
         productModel.setPrice(price);
         
         //String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
         String create_time=ParamUtil.getString(request,"product_model_create_time");
         productModel.setCreate_time(create_time);
         
         String description=ParamUtil.getString(request,"product_model_description");
         productModel.setDescription(description);
         
         if (ProductControl.updateProductModel(id)){
		%>
		<script type="text/javascript">
if (window.confirm("修改成功！"))
	window.location.href = "product_model.jsp";
	else
    window.location.href = "product_model.jsp";
</script>
		<%
			} else {
		%>
		<script type="text/javascript">
if (window.confirm("修改失败！"))
	window.location.href = "product_model.jsp";
	else
    window.location.href = "product_model.jsp";
</script>
		<%
			}
		%>
  </body>
</html>
